package com.morizhang.merchanmanager.api.service;

import com.alibaba.fastjson.JSONObject;
import com.morizhang.merchanmanager.api.ApiResult;
import com.morizhang.merchanmanager.api.IService;
import com.morizhang.merchanmanager.api.utils.BatchNoGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;

@ServiceAnnotation(name = "GenerateBatchNo")
public class GenerateBatchNoService implements IService {
    @Autowired
    private Environment environment;
    @Override
    public ApiResult callService(JSONObject requestParams) throws Exception {
        ApiResult result = new ApiResult();
        String batchNo = BatchNoGenerator.newBatchNo();
        result.setData(batchNo);
        result.setSuccess(true);
        return result;
    }
}
